/**********京东滚动商品 *********/
//获取变量
var content = document.getElementsByClassName("content")[0];
var content_div = document.getElementsByClassName("content_div")[0];
content_div.innerHTML = content_div.innerHTML + content_div.innerHTML;
var boxs = document.getElementsByClassName("boxs")[0];



content.scrollLeft = 0;  //初始化设置滚动条距离左侧间距
var $interval; //控制定时器
startIn();

//开始滚动
function startIn() {
    $interval = setInterval(function () {
        if (content.scrollLeft >= boxs.offsetWidth) {
            content.scrollLeft = 0;
        }
        content.scrollLeft++;
    }, 6);
}

//鼠标移入停止滚动出现滚动条
content.addEventListener("mouseover", function () {
    clearInterval($interval);
    content.style.overflow = "auto";
})
//鼠标移出开始滚动隐藏滚动条
content.addEventListener("mouseout", function () {
    startIn();
    content.style.overflow = "hidden";
})




/**********京东头部导航栏二级标签**********/
//获取变量
var mine_JD = document.getElementsByClassName("mine_JD")[0];
var mine_JD_a = mine_JD.getElementsByTagName("a")[0];
var mine_JD_mine_hidden = mine_JD.getElementsByClassName("mine_hidden")[0];

//鼠标移入显示下拉框
mine_JD.addEventListener("mouseover", function () {
    mine_JD_a.className = "a_hover";
    mine_JD_mine_hidden.style.display = "block";
});
//鼠标离开隐藏下拉框
mine_JD.addEventListener("mouseout", function () {
    mine_JD_a.removeAttribute("class");
    mine_JD_mine_hidden.removeAttribute("style");
});



/**********京东头部导航栏二级标签**********/
//获取变量
var mine_JD = document.getElementsByClassName("mine_JD")[1];
var mine_JD_style_red = mine_JD.getElementsByClassName("style_red")[0];
var mine_JD_public_hidden = mine_JD.getElementsByClassName("public_hidden")[0];

//鼠标移入显示下拉框
mine_JD.addEventListener("mouseover", function () {
    mine_JD_style_red.className = "a_hover";
    mine_JD_public_hidden.style.display = "block";
});
//鼠标离开隐藏下拉框
mine_JD.addEventListener("mouseout", function () {
    mine_JD_style_red.removeAttribute("class");
    mine_JD_public_hidden.removeAttribute("style");
});






/**********京东头部导航栏二级标签**********/
//获取变量
var mine_JD = document.getElementsByClassName("mine_JD")[2];
var mine_JD_small_hidden_a = mine_JD.getElementsByClassName("small_hidden_a")[0];
var mine_JD_small_hidden = mine_JD.getElementsByClassName("small_hidden")[0];

//鼠标移入显示下拉框
mine_JD.addEventListener("mouseover", function () {
    mine_JD_small_hidden_a.className = "a_hover";
    mine_JD_small_hidden.style.display = "block";
});
//鼠标离开隐藏下拉框
mine_JD.addEventListener("mouseout", function () {
    mine_JD_small_hidden_a.removeAttribute("class");
    mine_JD_small_hidden.removeAttribute("style");
});







/**********京东头部导航栏二级标签**********/
//获取变量
var mine_JD = document.getElementsByClassName("mine_JD")[3];
var mine_JD_big_hidden_a = mine_JD.getElementsByClassName("big_hidden_a")[0];
var mine_JD_big_hidden = mine_JD.getElementsByClassName("big_hidden")[0];

//鼠标移入显示下拉框
mine_JD.addEventListener("mouseover", function () {
    mine_JD_big_hidden_a.className = "a_hover";
    mine_JD_big_hidden.style.display = "block";
});
//鼠标离开隐藏下拉框
mine_JD.addEventListener("mouseout", function () {
    mine_JD_big_hidden_a.removeAttribute("class");
    mine_JD_big_hidden.removeAttribute("style");
});




/**********京东购物车二级标签**********/
//获取变量
var center_gouwuche = document.getElementsByClassName("center_gouwuche")[0];
var center_gouwuche_p = center_gouwuche.getElementsByTagName("p")[0];


//鼠标移入显示下拉框
center_gouwuche.addEventListener("mouseover", function () {
    center_gouwuche_p.style.display = "block";
});
//鼠标离开隐藏下拉框
center_gouwuche.addEventListener("mouseout", function () {
    center_gouwuche_p.style.display = "none";
});








/**********京东购物车二级标签**********/
//获取变量
var center_gouwuche_1 = document.getElementsByClassName("center_gouwuche_1")[0];
var center_gouwuche_1_p = center_gouwuche_1.getElementsByTagName("p")[0];


//鼠标移入显示下拉框
center_gouwuche_1.addEventListener("mouseover", function () {
    center_gouwuche_1_p.style.display = "block";
});
//鼠标离开隐藏下拉框
center_gouwuche_1.addEventListener("mouseout", function () {
    center_gouwuche_1_p.style.display = "none";
});






/**********京东隐藏导航搜索框特定高度出现**********/
var box = document.getElementById("search-fix");  //获取隐藏搜索框
//添加滚轮事件并添加相应的样式
document.documentElement.addEventListener("mousewheel", function () {
    if (document.documentElement.scrollTop >= 1000) {
        box.className = box.className + " search-fix_1";
        box.style.display = "block";
    } else {
        box.className = "";
        box.style.display = "none";
    }
})








